using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._Generalization
{
    /// <summary>
    /// <para>Simplify Building</para>
    /// <para>Simplifies the boundary or footprint of building polygons while maintaining their essential shape and size.</para>
    /// <para>简化建筑多边形的边界或占地面积，同时保持其基本形状和大小。</para>
    /// </summary>    
    [DisplayName("Simplify Building")]
    public class SimplifyBuilding : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SimplifyBuilding()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The building polygons to be simplified.</para>
        /// <para>要简化的建筑多边形。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class to be created.</para>
        /// <para>要创建的输出要素类。</para>
        /// </param>
        /// <param name="_simplification_tolerance">
        /// <para>Simplification Tolerance</para>
        /// <para>The tolerance for building simplification. A tolerance must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.</para>
        /// <para>对建筑简化的容忍度。必须指定公差，并且公差必须大于零。您可以选择首选单位;默认值为要素单位。</para>
        /// </param>
        public SimplifyBuilding(object _in_features, object _out_feature_class, string? _simplification_tolerance)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._simplification_tolerance = _simplification_tolerance;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Simplify Building";

        public override string CallName => "cartography.SimplifyBuilding";

        public override List<string> AcceptEnvironments => ["MDomain", "XYDomain", "XYTolerance", "cartographicPartitions", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _simplification_tolerance, _minimum_area, _conflict_option.GetGPValue(), _in_barriers, _out_point_feature_class, _collapsed_point_option.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The building polygons to be simplified.</para>
        /// <para>要简化的建筑多边形。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class to be created.</para>
        /// <para>要创建的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Simplification Tolerance</para>
        /// <para>The tolerance for building simplification. A tolerance must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.</para>
        /// <para>对建筑简化的容忍度。必须指定公差，并且公差必须大于零。您可以选择首选单位;默认值为要素单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplification Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _simplification_tolerance { get; set; }


        /// <summary>
        /// <para>Minimum Area</para>
        /// <para>The minimum area for a simplified building to be retained in feature units. The default value is zero, that is, to keep all buildings. You can specify a preferred unit; the default is the feature unit.</para>
        /// <para>简化建筑在要素单元中保留的最小面积。默认值为零，即保留所有建筑物。您可以指定首选单位;默认值为要素单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Area")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _minimum_area { get; set; } = null;


        /// <summary>
        /// <para>Check for spatial conflicts</para>
        /// <para><xdoc>
        ///   <para>Specifies whether spatial conflicts—that is, overlapping or touching among buildings—will be identified. A SimBldFlag field is added to the output to store conflict flags. A value of 0 means no conflict; a value of 1 means conflict.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Spatial conflicts will not be identified; the resulting buildings may overlap. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—Spatial conflicts will be identified and the conflicting buildings will be flagged.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否识别空间冲突（即建筑物之间的重叠或接触）。将 SimBldFlag 字段添加到输出中以存储冲突标志。值为 0 表示没有冲突;值为 1 表示冲突。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不会识别空间冲突;由此产生的建筑物可能会重叠。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 将识别空间冲突并标记冲突的建筑物。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Check for spatial conflicts")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _conflict_option_value _conflict_option { get; set; } = _conflict_option_value._false;

        public enum _conflict_option_value
        {
            /// <summary>
            /// <para>CHECK_CONFLICTS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CHECK_CONFLICTS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_CHECK</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_CHECK")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Input barrier layers</para>
        /// <para>The input layers containing features to act as barriers for simplification. Resulting simplified buildings will not touch or cross barrier features. For example, when simplifying buildings, the resulting simplified building areas do not cross road features defined as barriers.</para>
        /// <para>包含要素的输入图层可作为简化的障碍。由此产生的简化建筑不会触及或跨越障碍物。例如，在简化建筑物时，生成的简化建筑区域不会穿过定义为障碍物的道路要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input barrier layers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_barriers { get; set; } = null;


        /// <summary>
        /// <para>Polygons Collapsed To Zero Area</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Polygons Collapsed To Zero Area")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_point_feature_class { get; set; }


        /// <summary>
        /// <para>Keep collapsed points</para>
        /// <para><xdoc>
        ///   <para>Specifies whether an output point feature class will be created to store the centers of any buildings that are removed because they are smaller than the Minimum Area parameter value. The point output is derived, is named the same as the output feature class specified in the Output Feature Class parameter but with a _Pnt suffix, and is located in the same folder.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—A derived output point feature class will be created to store the centers of buildings that are removed.</bullet_item><para/>
        ///     <bullet_item>Unchecked— An output point class will not be created. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否创建输出点要素类来存储因小于最小面积参数值而移除的任何建筑物的中心。点输出是派生的，其名称与输出要素类参数中指定的输出要素类相同，但具有_Pnt后缀，并且位于同一文件夹中。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将创建派生输出点要素类以存储移除的建筑物的中心。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会创建输出点类。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep collapsed points")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _collapsed_point_option_value _collapsed_point_option { get; set; } = _collapsed_point_option_value._false;

        public enum _collapsed_point_option_value
        {
            /// <summary>
            /// <para>KEEP_COLLAPSED_POINTS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_COLLAPSED_POINTS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_KEEP</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_KEEP")]
            [GPEnumValue("false")]
            _false,

        }

        public SimplifyBuilding SetEnv(object MDomain = null, object XYDomain = null, object XYTolerance = null, object cartographicPartitions = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, XYDomain: XYDomain, XYTolerance: XYTolerance, cartographicPartitions: cartographicPartitions, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}